//2009/08/28 11:44:28
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

int x1[] = {-1, 0, 1, 0};
int y1[] = {0, 1, 0, -1};
int x2[] = {-1, 1, 1, -1};
int y2[] = {1, 1, -1, -1};

class HappyCells
{
public:
    vector <int> getHappy(vector <string> grid)
    {
        int a = 0;
        int b = 0;
        int c = 0;
        for (int i=0; i<grid.size(); i++)
            for (int j=0; j<grid[i].size(); j++)
            {
                int temp1 = orthogonal(i, j, grid);
                int temp2 = diagonal(i, j, grid);
                if (grid[i][j]=='.' && temp1 == 4 && temp2 == 4)
                {
                    a++;
                    continue;
                }
                if (grid[i][j]=='.' && temp1 == 4 && temp2 < 4)
                {
                    b++;
                    continue;
                }
                if (grid[i][j]=='.' && temp1 <4 && temp2 == 4)
                {
                    c++;
                    continue;
                }
            }
        vector<int> v;
        v.push_back(a);
        v.push_back(b);
        v.push_back(c);
        return v;
    }
    bool inBound(int x, int y, vector<string>& g)
    {
        if (x>=0 && x<g.size() && y>=0 && y<g[0].size()) return true;
        return false;
    }
    int orthogonal(int x, int y, vector<string> g)
    {
        int ret = 4;
        for (int i=0; i<4; i++)
        {
            int xtemp = x + x1[i];
            int ytemp = y + y1[i];
            if (inBound(xtemp, ytemp, g) && g[xtemp][ytemp] == '.')
                ret--;
        }
        return ret;
    }
    int diagonal(int x, int y, vector<string> g)
    {
        int ret = 4;
        for (int i=0; i<4; i++)
        {
            int xtemp = x + x2[i];
            int ytemp = y + y2[i];
            if (inBound(xtemp, ytemp, g) && g[xtemp][ytemp] == '.')
                ret--;
        }
        return ret;
    }
};
